package hhm.ssm.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import hhm.ssm.mybatis.pojo.Users;
import hhm.ssm.service.IUsersService;

@Controller
@RequestMapping("/user")
public class UserController {
	@Autowired
	private IUsersService usersService;

	@RequestMapping("/showUser")
	public String toIndex(HttpServletRequest request, Model model) {
		int userId = Integer.parseInt(request.getParameter("id"));
		Users users = this.usersService.exchange(userId);
		model.addAttribute("users", users);
		return "showUser";
	}
}
